package com.aeye.mbr.upms.dao.model;

import com.aeye.mbr.model.constant.UpmsDatabaseConstants;
import com.gitee.sunchenbin.mybatis.actable.annotation.DBColumn;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

@Table(name = UpmsDatabaseConstants.TABLE_UPMS_CUSTOM)
public class UpmsCustom implements Serializable {
    /**
     * 编号
     *
     * @mbg.generated
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "AESEQ_CUSTOM")
    @DBColumn(type = MySqlTypeConstant.INT,length = 10,isKey = true)
    private Integer customId;

    /**
     * 客户名称
     *
     * @mbg.generated
     */
    @DBColumn(type = MySqlTypeConstant.VARCHAR,length = 32)
    private String customName;

    /**
     * 描述
     *
     * @mbg.generated
     */
    @DBColumn(type = MySqlTypeConstant.VARCHAR,length = 64)
    private String description;

    /**
     * 所属系统
     *
     * @mbg.generated
     */
    @DBColumn(type = MySqlTypeConstant.INT,length = 10)
    private Integer systemId;

    /**
     * 状态(0:正常,1:锁定)
     *
     * @mbg.generated
     */
    @DBColumn(type = MySqlTypeConstant.INT,length = 4)
    private Byte locked;

    /**
     * 创建时间
     *
     * @mbg.generated
     */
    @DBColumn(type = MySqlTypeConstant.DATETIME)
    private Date ctime;

    public Integer getCustomId() {
        return customId;
    }

    public void setCustomId(Integer customId) {
        this.customId = customId;
    }

    public String getCustomName() {
        return customName;
    }

    public void setCustomName(String customName) {
        this.customName = customName;
    }

    public Integer getSystemId() {
        return systemId;
    }

    public void setSystemId(Integer systemId) {
        this.systemId = systemId;
    }

    public Byte getLocked() {
        return locked;
    }

    public void setLocked(Byte locked) {
        this.locked = locked;
    }

    public Date getCtime() {
        return ctime;
    }

    public void setCtime(Date ctime) {
        this.ctime = ctime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UpmsCustom that = (UpmsCustom) o;

        if (customId != null ? !customId.equals(that.customId) : that.customId != null) return false;
        if (customName != null ? !customName.equals(that.customName) : that.customName != null) return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;
        if (systemId != null ? !systemId.equals(that.systemId) : that.systemId != null) return false;
        if (locked != null ? !locked.equals(that.locked) : that.locked != null) return false;
        return ctime != null ? ctime.equals(that.ctime) : that.ctime == null;
    }

    @Override
    public int hashCode() {
        int result = customId != null ? customId.hashCode() : 0;
        result = 31 * result + (customName != null ? customName.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        result = 31 * result + (systemId != null ? systemId.hashCode() : 0);
        result = 31 * result + (locked != null ? locked.hashCode() : 0);
        result = 31 * result + (ctime != null ? ctime.hashCode() : 0);
        return result;
    }


}